package reversing_string;

public class reverse_string {

	public char[] reverseString(String input) {

		char[] carr = input.toCharArray();
		char[] rev_arr = new char[carr.length];

		for (int i = 0,j=rev_arr.length-1; i < carr.length && j>=0; i++,j--) {
			System.out.print(carr[i]);
			
			rev_arr[j] = carr[i];

		}
		System.out.println();
		return rev_arr;

	}

	public void printArray(char[] rev_arr) {
			
		for (int i = 0; i < rev_arr.length; i++) {
			System.out.print(rev_arr[i]);
		}
		
	}
}
